import { createRouter, createWebHistory } from 'vue-router'
import HomeView from '../views/HomeView.vue'

const routes = [
  {
    path: '/',
    name: 'home',
    component: HomeView,
    redirect:'/team',
    children:[
      {path: '/resident', component: () => import('../views/resident/resident.vue')},
      {path: '/pendingSigning', component: () => import('../views/signing/PendingSigning.vue')},
      {path: '/underaudit', component: () => import('../views/signing/UnderAudit.vue')},
      {path: '/underpay', component: () => import('../views/signing/UnderPay.vue')},
      {path: '/reject', component: () => import('../views/signing/Reject.vue')},
      {path: '/edit', component: () => import('../views/signing/Edit.vue')},
      {path: '/signingRecords', component: () => import('../views/signing/SigningRecords.vue')},
      {path: '/active', component: () => import('../views/signing/Active.vue')},
      {path: '/expaired', component: () => import('../views/signing/Expaired.vue')},
      {path: '/serviceRecords', component: () => import('../views/service/ServiceRecords.vue')},
      {path: '/pendingService', component: () => import('../views/service/PendingService.vue')},
      {path: '/doctor', component: () => import('../views/data/Doctor.vue')},
      {path: '/institution', component: () => import('../views/data/Institution.vue')},
      {path: '/serviceItem', component: () => import('../views/data/ServiceItem.vue')},
      {path: '/servicePackage', component: () => import('../views/data/ServicePackage.vue')},
      {path: '/team', component: () => import('../views/data/Team.vue')}
    ]
  },
  {
    path: '/about',
    name: 'about',
    // route level code-splitting
    // this generates a separate chunk (about.[hash].js) for this route
    // which is lazy-loaded when the route is visited.
    component: () => import(/* webpackChunkName: "about" */ '../views/LoginView.vue')
  }
]

const router = createRouter({
  history: createWebHistory(process.env.BASE_URL),
  routes
})

export default router
